﻿namespace Little.Soldier.SWIFT.Validation
{
  public abstract class ValidationRuleBase : IValidationRule
  {
    private string U0001 = string.Empty;
    private int U0002 = -1;
    private int U0003 = -1;
    private char U0004;
    private int U0005;

    public virtual string ErrorDescription
    {
      get
      {
        return this.U0001;
      }
      set
      {
        this.U0001 = value;
      }
    }

    public int StartIndex
    {
      get
      {
        return this.U0002;
      }
      set
      {
        this.U0002 = value;
      }
    }

    public int Length
    {
      get
      {
        return this.U0003;
      }
      set
      {
        this.U0003 = value;
      }
    }

    public char Delimiter
    {
      get
      {
        return this.U0004;
      }
      set
      {
        this.U0004 = value;
      }
    }

    public int Count
    {
      get
      {
        return this.U0005;
      }
      set
      {
        this.U0005 = value;
      }
    }

    public ValidationRuleBase()
    {
    }

    public ValidationRuleBase(string errorDescription)
    {
      this.ErrorDescription = errorDescription;
    }

    public ValidationRuleBase(int startIndex)
    {
      this.StartIndex = startIndex;
    }

    public ValidationRuleBase(int startIndex, int length)
    {
      this.StartIndex = startIndex;
      this.Length = length;
    }

    public ValidationRuleBase(char delimiter, int count)
    {
      this.Delimiter = delimiter;
      this.Count = count;
    }

    public ValidationRuleBase(char delimiter, int count, string errorDescription)
    {
      this.Delimiter = delimiter;
      this.Count = count;
      this.ErrorDescription = errorDescription;
    }

    public ValidationRuleBase(int startIndex, int length, string errorDescription)
    {
      this.StartIndex = startIndex;
      this.ErrorDescription = errorDescription;
      this.Length = length;
    }

    internal void U0003U0003(ref string value)
    {
      // ISSUE: unable to decompile the method.
    }

    public abstract ValidationError[] Validate(string value);
  }
}
